package com.mobileagri.backoffice.model;

import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonAutoDetect;

/**
 * Contact POJO
 * 
 * 
 * @author LOUVET Romain
 */
@JsonAutoDetect
@Entity
@Table(name = "message")
public class Message extends AbstractObject {

	@Id
	@GeneratedValue
	@Column(name = "id_message")
	private int id;

	// private int idDest;
	// @Column(name = "id_dest")
	@OneToOne
	@JoinColumn(name = "id_dest")
	private Utilisateur userDest;

	// private int idEmet;
	// @Column(name = "id_emet")
	@OneToOne
	@JoinColumn(name = "id_emet")
	private Utilisateur userEmet;

	@Column(name = "objet")
	private String objet;

	@Column(name = "message_texte")
	private String message;

	@Column(name = "lu")
	private Boolean lu;

	@Column(name = "date")
	private Date date;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Utilisateur getUserDest() {
		return userDest;
	}

	public void setUserDest(Utilisateur userDest) {
		this.userDest = userDest;
	}

	public Utilisateur getUserEmet() {
		return userEmet;
	}

	public void setUserEmet(Utilisateur userEmet) {
		this.userEmet = userEmet;
	}

	public String getObjet() {
		return objet;
	}

	public void setObjet(String objet) {
		this.objet = objet;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Boolean getLu() {
		return lu;
	}

	public void setLu(Boolean lu) {
		this.lu = lu;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

}
